<?php
function user_logincheck()
{
	if (!isset($_SESSION['username']) ||$_SESSION['username'] == '')
	{
		echo "<script>window.parent.location.href='login.php';</script>";
		exit;
	}
}

function user_online($logintime = 8200)
{
	$now = mktime();
	if (!$this->checkbasename() &&($now -$_SESSION['ontime'] >$logintime))
	{
		session_destroy();
		$this->showmsg("登陆已超时，请重新登录",self::LOGINURL);
	}else 
	{
		$_SESSION['ontime'] = mktime();
	}
}